/**
 * 
 */
package com.zhanggz.mypattern.observer;

/**
 * 具体的观察者对象，实现更新的方法，使自身的状态与目标的状态保持一致
 * 
 * @author Alex
 * @date 2015年6月23日
 */
public class ConcreteObserver implements Observer {

	/**
	 * 观察者名称
	 */
	private String observerName;

	/**
	 * 天气状态
	 */
	private String weatherContent;

	/**
	 * 提醒内容
	 */
	private String remindThing;

	/*
	 * 获取到目标类的状态，同步到观察者的状态中
	 * 
	 * @see
	 * com.zhanggz.mypattern.observer.Observer#update(com.zhanggz.mypattern.
	 * observer.Subject)
	 */
	public void update(WeatherSubject subject) {
		weatherContent = ((ConcreteWeatherSubject) subject).getWeatherState();
		System.out.println(observerName + "收到了" + weatherContent + ","
				+ remindThing);
	}

	/**
	 * @return the observerName
	 */
	public String getObserverName() {
		return observerName;
	}

	/**
	 * @param observerName
	 *            the observerName to set
	 */
	public void setObserverName(String observerName) {
		this.observerName = observerName;
	}

	/**
	 * @return the weatherContent
	 */
	public String getWeatherContent() {
		return weatherContent;
	}

	/**
	 * @param weatherContent
	 *            the weatherContent to set
	 */
	public void setWeatherContent(String weatherContent) {
		this.weatherContent = weatherContent;
	}

	/**
	 * @return the remindThing
	 */
	public String getRemindThing() {
		return remindThing;
	}

	/**
	 * @param remindThing
	 *            the remindThing to set
	 */
	public void setRemindThing(String remindThing) {
		this.remindThing = remindThing;
	}

}
